package cn.lngaosu.lwyd.module.integration.dal.mysql.weixinarticleanalysis;

import java.util.*;

import cn.lngaosu.lwyd.framework.common.pojo.PageResult;
import cn.lngaosu.lwyd.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.lngaosu.lwyd.framework.mybatis.core.mapper.BaseMapperX;
import cn.lngaosu.lwyd.module.integration.dal.dataobject.weixinarticleanalysis.WeixinArticleAnalysisDO;
import org.apache.ibatis.annotations.Mapper;
import cn.lngaosu.lwyd.module.integration.controller.admin.weixinarticleanalysis.vo.*;

/**
 * 微信文章分析 Mapper
 *
 * @author 张恒
 */
@Mapper
public interface WeixinArticleAnalysisMapper extends BaseMapperX<WeixinArticleAnalysisDO> {

    default PageResult<WeixinArticleAnalysisDO> selectPage(WeixinArticleAnalysisPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<WeixinArticleAnalysisDO>()
                .betweenIfPresent(WeixinArticleAnalysisDO::getCreateTime, reqVO.getCreateTime())
                .betweenIfPresent(WeixinArticleAnalysisDO::getRefDate, reqVO.getRefDate())
                .eqIfPresent(WeixinArticleAnalysisDO::getRefHour, reqVO.getRefHour())
                .eqIfPresent(WeixinArticleAnalysisDO::getMsgid, reqVO.getMsgid())
                .eqIfPresent(WeixinArticleAnalysisDO::getTitle, reqVO.getTitle())
                .eqIfPresent(WeixinArticleAnalysisDO::getIntPageReadUser, reqVO.getIntPageReadUser())
                .eqIfPresent(WeixinArticleAnalysisDO::getIntPageReadCount, reqVO.getIntPageReadCount())
                .eqIfPresent(WeixinArticleAnalysisDO::getOriPageReadUser, reqVO.getOriPageReadUser())
                .eqIfPresent(WeixinArticleAnalysisDO::getOriPageReadCount, reqVO.getOriPageReadCount())
                .eqIfPresent(WeixinArticleAnalysisDO::getShareUser, reqVO.getShareUser())
                .eqIfPresent(WeixinArticleAnalysisDO::getShareCount, reqVO.getShareCount())
                .eqIfPresent(WeixinArticleAnalysisDO::getAddToFavUser, reqVO.getAddToFavUser())
                .eqIfPresent(WeixinArticleAnalysisDO::getAddToFavCount, reqVO.getAddToFavCount())
                .eqIfPresent(WeixinArticleAnalysisDO::getDataTypeCode, reqVO.getDataTypeCode())
                .eqIfPresent(WeixinArticleAnalysisDO::getDataType, reqVO.getDataType())
                .orderByDesc(WeixinArticleAnalysisDO::getId));
    }

}